#ifndef classGOST28147H
 #define classGOST28147H


/****************************************************************************************************/
/*                              L O W L E V E L     D E F I N E                                     */
/*                               ( d o n ' t     c h a n g e )                                      */
/****************************************************************************************************/
  #define MOD32_1       0xFFFFFFFF
  #define C1gen         0x01010101
  #define C2gen         0x01010104
  #define BiMAX       ( MOD32_1-C2gen )








class GOST28147
{
//  bool grab, fatal_err;
  uint32_t AloGen, BhiGen;

private:  
  void ForwardCycle(uint32_t *pN1, uint32_t *pN2);
  void BackCycle(uint32_t *pN1, uint32_t *pN2);
  void MainStep(uint32_t *pN1, uint32_t *pN2, uint32_t X);
  uint32_t TablChanging(uint32_t valIn);
  void swap(uint32_t *pA, uint32_t *pB);

public:
//
  GOST28147(void) {};
//  
  void INITgen(uint32_t *pBhi, uint32_t *pAlo);
  //void TACTgen(void);
  void TACTgen(uint32_t *pBhi, uint32_t *pAlo);
  void XORgen(uint32_t *pDataHi, uint32_t *pDataLo);
//
  void EncryptionCycle(uint32_t *pBhi, uint32_t *pAlo);
  void DecryptionCycle(uint32_t *pBhi, uint32_t *pAlo);
  void AuthenticationCycle(uint32_t *pN1, uint32_t *pN2);
//
  
//
};


#endif